#ifndef RANGE_H
#define RANGE_H

#include <QSharedDataPointer>
#include "shredmateengine_global.h"

#include "marker.h"

class RangeData;

class SHREDMATEENGINESHARED_EXPORT Range
{
public:
    Range();
    Range(Marker marker1, Marker marker2);
    Range(Marker marker1, Marker marker2, QString name);
    Range(const Range &);
    Range &operator=(const Range &);
    bool operator ==(const Range& rhs) const;

    ~Range();

    QString name() const;
    void setName(QString name);

    bool isValid() const;

    Marker marker1() const;
    void setMarker1(Marker marker) const;

    Marker marker2() const;
    void setMarker2(Marker marker) const;

    Marker lowerMarker() const;
    Marker upperMarker() const;
    qint64 length() const;

private:
    QExplicitlySharedDataPointer<RangeData> data;
};

QDataStream& operator<<(QDataStream& stream, const Range& range);
QDataStream& operator>>(QDataStream& stream, Range& range);

#endif // RANGE_H
